
{literal}

<script>

</script>


<style>

#discussions .thread{
	padding: 2px;
	margin-top: 10px;
	border-bottom: 1px dotted silver;
}

#discussions .recipient{
	width: 100px;
	font-size: 10pt;
}
#discussions .recipient a:link{

}
#discussions .recipient a:hover{

}

#discussions .title{
	width: 340px;
	font-size: 10pt;
}

#discussions .date{
	width: 120px;
	font-size: 9pt;
}

#discussions .direction{
	width: 45px;
	font-size: 11pt;
	font-weight: bold;
}

#discussions .recipient-header{
	width: 100px;
	font-size: 10pt;
}

#discussions .title-header{
	width: 340px;
	font-size: 10pt;
}

#discussions .date-header{
	width: 120px;
	font-size: 10pt;
}

#discussions .direction-header{
	width: 45px;
	font-size: 10pt;
	font-weight: bold;
}

#discussions .filters{
	font-size: 10pt;
	margin-top: 3px;
	margin-bottom: 3px;
	
}

#discussions .filters a:link{
	padding-right: 3px;
	padding-left: 3px;
	text-decoration: underline;	
}

#discussions .filters a:hover{
	color: #FFFFFF;
	background-color: #008DC7;
}

#discussions .selected {
	color: #FFFFFF;
	background-color: #008DC7;
}

#discussions .separator{
	margin-right: 2px;
	border-right: 1px dotted silver;
	padding-left: 0px;
	padding-right: 0px;
}


</style>
{/literal}
{strip}

<div id="content">
    <div id="content_left">
    	<h1>Conversations Inbox</h1>
    	<div id="discussions">
	    	<div class="filters">
	        	<a href="/account/inbox" {if $activeButton == 'all' || $activeButton == ''}class="selected"{/if}>all</a>
	        	<em class="separator"> </em><a href="/account/inbox/unread" {if $activeButton == 'unread'}class="selected"{/if}>unread</a>
	        	<em class="separator"> </em><a href="/account/inbox/archived" {if $activeButton == 'archived'}class="selected"{/if}>archived</a>
	        </div>
	                	
	        	<div class="thread">
	        		<div class="left recipient-header">
	        			<b>Recipient</b>
	        		</div>
	        		<div class="left direction-header">
	        			<b>in/out</b>
	        		</div>
	        		<div class="left title-header">
	        			<b>Title</b>
	        		</div>
	        		<div class="right date-header">
	        			<b>Last message</b>
	        		</div>
					<div class="clear"></div>
				</div>
	        	{foreach $discussions as $d}
	        	<div class="thread">
	        		<div class="left recipient">
	        			{if $d->getRecipient()->getId() == $loggedUser->getId()}from: <a href="/users/{$d->getAuthor()->getUsername()}">{$d->getAuthor()->getUsername()}</a>{else}to: <a href="/users/{$d->getRecipient()->getUsername()}">{$d->getRecipient()->getUsername()}</a>{/if}
	        		</div>
	        		<div class="left direction">
	        		{if $d->getLastComment()->getUsersId() == $loggedUser->getId()}>>{else}<<{/if}
	        		</div>
	        		<div class="left title">
	        			<a href="/account/inbox/discussion/{$d->getId()}">{$d->getFirstComment()->getContent()|truncate:100}</a>
	        		</div>
	        		<div class="right date">
	        			{$d->getLastComment()->getAddDate()}<br /><a class="right" href="/users/{$d->getLastComment()->getUser()->getUsername()}">by {$d->getLastComment()->getUser()->getUsername()}</a>
	        		</div>
					<div class="clear"></div>
				</div>
	        	{/foreach}	
	        
        </div>
	</div>
	<div id="content_right">
		{include file='account/menu.tpl'}
	</div>
</div>
<!-- end content  -->


{/strip}